package com.woniu.controller;


import com.woniu.entity.Result;
import com.woniu.pojo.Experiment;
import com.woniu.service.IExperimentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaosong
 * @since 2023-04-03
 */
@RestController
@RequestMapping("/experiment")
@Api(tags = "实验详情管理")
public class ExperimentController extends BaseController{

     @Autowired
     private IExperimentService experimentService;


    @ApiOperation("实验详情展示")
    @GetMapping("/detail/{trainingId}")
    public Result SelectExperiment(@PathVariable Integer trainingId){
//        通过靶场id展示对应的实验详情数据
        Experiment experiment  = experimentService.getById(trainingId);
        return toDataResult(experiment);

    }

}
